// $ANTLR 3.4 C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g 2012-05-05 13:59:45

package com.plt.w2w;
import java.util.Map;
import java.util.HashMap;
import java.io.*;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class trialParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "AND", "CONDITIONAL_OP", "DATE", "DELIMITER", "ELSE", "ENDOFSTMT", "EXPR", "GARMENT", "IDENTIFIER", "IF", "LEFTCURLY", "LEFTPARAN", "NUMBER", "OR", "QUOTE", "REJTOK", "RETTOK", "RIGHTCURLY", "RIGHTPARAN", "TIME", "WARDROBET", "WS", "' in the '", "'assignmentStatement'", "'for each '"
    };

    public static final int EOF=-1;
    public static final int T__26=26;
    public static final int T__27=27;
    public static final int T__28=28;
    public static final int AND=4;
    public static final int CONDITIONAL_OP=5;
    public static final int DATE=6;
    public static final int DELIMITER=7;
    public static final int ELSE=8;
    public static final int ENDOFSTMT=9;
    public static final int EXPR=10;
    public static final int GARMENT=11;
    public static final int IDENTIFIER=12;
    public static final int IF=13;
    public static final int LEFTCURLY=14;
    public static final int LEFTPARAN=15;
    public static final int NUMBER=16;
    public static final int OR=17;
    public static final int QUOTE=18;
    public static final int REJTOK=19;
    public static final int RETTOK=20;
    public static final int RIGHTCURLY=21;
    public static final int RIGHTPARAN=22;
    public static final int TIME=23;
    public static final int WARDROBET=24;
    public static final int WS=25;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public trialParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public trialParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return trialParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g"; }



    // $ANTLR start "lines"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:18:1: lines returns [String val] : ( line l1= lines |);
    public final String lines() throws RecognitionException {
        String val = null;


        String l1 =null;

        String line1 =null;


        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:19:3: ( line l1= lines |)
            int alt1=2;
            int LA1_0 = input.LA(1);

            if ( (LA1_0==IF||(LA1_0 >= REJTOK && LA1_0 <= RETTOK)||(LA1_0 >= 27 && LA1_0 <= 28)) ) {
                alt1=1;
            }
            else if ( (LA1_0==RIGHTCURLY) ) {
                alt1=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 1, 0, input);

                throw nvae;

            }
            switch (alt1) {
                case 1 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:20:3: line l1= lines
                    {
                    pushFollow(FOLLOW_line_in_lines47);
                    line1=line();

                    state._fsp--;


                    pushFollow(FOLLOW_lines_in_lines51);
                    l1=lines();

                    state._fsp--;



                        val = line1 + "\n" + l1;
                      

                    }
                    break;
                case 2 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:25:3: 
                    {
                     val = "" 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return val;
    }
    // $ANTLR end "lines"



    // $ANTLR start "line"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:28:1: line returns [String val] : ( 'assignmentStatement' | 'for each ' GARMENT ' in the ' WARDROBET LEFTCURLY lines RIGHTCURLY | IF LEFTPARAN expr RIGHTPARAN LEFTCURLY lines RIGHTCURLY optional_tail | REJTOK ENDOFSTMT | RETTOK IDENTIFIER ENDOFSTMT );
    public final String line() throws RecognitionException {
        String val = null;


        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:29:4: ( 'assignmentStatement' | 'for each ' GARMENT ' in the ' WARDROBET LEFTCURLY lines RIGHTCURLY | IF LEFTPARAN expr RIGHTPARAN LEFTCURLY lines RIGHTCURLY optional_tail | REJTOK ENDOFSTMT | RETTOK IDENTIFIER ENDOFSTMT )
            int alt2=5;
            switch ( input.LA(1) ) {
            case 27:
                {
                alt2=1;
                }
                break;
            case 28:
                {
                alt2=2;
                }
                break;
            case IF:
                {
                alt2=3;
                }
                break;
            case REJTOK:
                {
                alt2=4;
                }
                break;
            case RETTOK:
                {
                alt2=5;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;

            }

            switch (alt2) {
                case 1 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:30:4: 'assignmentStatement'
                    {
                    match(input,27,FOLLOW_27_in_line83); 


                        val = $assignmentStatement.val;
                       

                    }
                    break;
                case 2 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:34:7: 'for each ' GARMENT ' in the ' WARDROBET LEFTCURLY lines RIGHTCURLY
                    {
                    match(input,28,FOLLOW_28_in_line96); 

                    match(input,GARMENT,FOLLOW_GARMENT_in_line98); 

                    match(input,26,FOLLOW_26_in_line100); 

                    match(input,WARDROBET,FOLLOW_WARDROBET_in_line102); 

                    match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_line105); 

                    pushFollow(FOLLOW_lines_in_line107);
                    lines();

                    state._fsp--;


                    match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_line109); 


                          val = "for ( Garment " + $variableName.text + ": garmentArrayList ) {\n" + $block.val + "}";
                        

                    }
                    break;
                case 3 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:38:7: IF LEFTPARAN expr RIGHTPARAN LEFTCURLY lines RIGHTCURLY optional_tail
                    {
                    match(input,IF,FOLLOW_IF_in_line123); 

                    match(input,LEFTPARAN,FOLLOW_LEFTPARAN_in_line125); 

                    pushFollow(FOLLOW_expr_in_line127);
                    expr();

                    state._fsp--;


                    match(input,RIGHTPARAN,FOLLOW_RIGHTPARAN_in_line129); 

                    match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_line131); 

                    pushFollow(FOLLOW_lines_in_line133);
                    lines();

                    state._fsp--;


                    match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_line135); 

                    pushFollow(FOLLOW_optional_tail_in_line137);
                    optional_tail();

                    state._fsp--;


                    }
                    break;
                case 4 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:39:7: REJTOK ENDOFSTMT
                    {
                    match(input,REJTOK,FOLLOW_REJTOK_in_line145); 

                    match(input,ENDOFSTMT,FOLLOW_ENDOFSTMT_in_line147); 


                          val = "";
                        

                    }
                    break;
                case 5 :
                    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:43:5: RETTOK IDENTIFIER ENDOFSTMT
                    {
                    match(input,RETTOK,FOLLOW_RETTOK_in_line159); 

                    match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_line161); 

                    match(input,ENDOFSTMT,FOLLOW_ENDOFSTMT_in_line163); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return val;
    }
    // $ANTLR end "line"



    // $ANTLR start "optional_tail"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:46:1: optional_tail : ELSE LEFTCURLY lines RIGHTCURLY ;
    public final void optional_tail() throws RecognitionException {
        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:46:14: ( ELSE LEFTCURLY lines RIGHTCURLY )
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:46:16: ELSE LEFTCURLY lines RIGHTCURLY
            {
            match(input,ELSE,FOLLOW_ELSE_in_optional_tail175); 

            match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_optional_tail177); 

            pushFollow(FOLLOW_lines_in_optional_tail179);
            lines();

            state._fsp--;


            match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_optional_tail181); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "optional_tail"



    // $ANTLR start "expr"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:48:1: expr : 'expr' ;
    public final void expr() throws RecognitionException {
        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:48:5: ( 'expr' )
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:48:7: 'expr'
            {
            match(input,EXPR,FOLLOW_EXPR_in_expr192); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "expr"



    // $ANTLR start "value"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:66:1: value : IDENTIFIER ;
    public final void value() throws RecognitionException {
        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:66:8: ( IDENTIFIER )
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:66:11: IDENTIFIER
            {
            match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_value261); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "value"



    // $ANTLR start "variableName"
    // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:68:1: variableName : IDENTIFIER ;
    public final void variableName() throws RecognitionException {
        try {
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:68:15: ( IDENTIFIER )
            // C:\\Users\\Kunal\\PLT\\PLT-W2W\\src\\com\\plt\\w2w\\trial.g:68:18: IDENTIFIER
            {
            match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_variableName273); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "variableName"

    // Delegated rules


 

    public static final BitSet FOLLOW_line_in_lines47 = new BitSet(new long[]{0x0000000018182000L});
    public static final BitSet FOLLOW_lines_in_lines51 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_27_in_line83 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_28_in_line96 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_GARMENT_in_line98 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_26_in_line100 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_WARDROBET_in_line102 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_LEFTCURLY_in_line105 = new BitSet(new long[]{0x0000000018382000L});
    public static final BitSet FOLLOW_lines_in_line107 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_line109 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IF_in_line123 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_LEFTPARAN_in_line125 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_expr_in_line127 = new BitSet(new long[]{0x0000000000400000L});
    public static final BitSet FOLLOW_RIGHTPARAN_in_line129 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_LEFTCURLY_in_line131 = new BitSet(new long[]{0x0000000018382000L});
    public static final BitSet FOLLOW_lines_in_line133 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_line135 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_optional_tail_in_line137 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_REJTOK_in_line145 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_ENDOFSTMT_in_line147 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RETTOK_in_line159 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_IDENTIFIER_in_line161 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_ENDOFSTMT_in_line163 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ELSE_in_optional_tail175 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_LEFTCURLY_in_optional_tail177 = new BitSet(new long[]{0x0000000018382000L});
    public static final BitSet FOLLOW_lines_in_optional_tail179 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_optional_tail181 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EXPR_in_expr192 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENTIFIER_in_value261 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENTIFIER_in_variableName273 = new BitSet(new long[]{0x0000000000000002L});

}